#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <openCV/highgui.h>
#include <openCV/cv.h>
#include <vector>

#include "cellule.hpp"
#include "colors.hpp"
using namespace std;

#ifndef _REGIONGROWING
#define _REGIONGROWING

class RegionGrowing
{
	private:
		IplImage* img;
		Cellule* tab;
		vector<Colors> colorsRegion;
		bool noir;
		
	public:
		RegionGrowing():img(NULL),tab(NULL),colorsRegion(NULL),noir(false){}
		RegionGrowing(IplImage* i);
		~RegionGrowing();
		
		IplImage* getImg();
		Cellule* getTab();
		vector<Colors> getColorsRegion();
		Cellule getTabIndex(int x, int y);
		Colors getColorsRegionIndex(int i);
		uchar* getPixel(int x,int y);
		
		void setImg(IplImage* i);
		void setTab(Cellule* t);
		void setColorsRegion(vector<Colors> cr);
		void setTabIndex(Cellule c,int x, int y);
		void setColorsRegionIndex(int i,int r,int g,int b);
		void setPixel(int x,int y,uchar r,uchar g,uchar b);
		
		void croissance();
		void poseGerme();
		void recurtionInitialisation(int , int , int , int);
		IplImage* rendu();
		IplImage* frontiere(IplImage*);
		void fusion();
};

#endif

